<template>
  <div class="main">
    <div class="title">疫苗接种系统</div>
    <div style="flex: 1"></div>
    <div style="width: 100px">
      <el-dropdown>
        <span class="el-dropdown-link">
          {{ name }}<i class="el-icon-arrow-down el-icon--right"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item @click.native="quitLogin"
            >退出系统</el-dropdown-item
          >
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
export default {
  name: "Header",
  data() {
    return { name: window.sessionStorage.getItem("username") };
  },
  methods: {
    quitLogin() {
      this.$router.push("/login");
    },
    update() {
      this.name = window.sessionStorage.getItem("username")
    }
  },
};
</script>

<style scoped>
.main {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #ccc;
  display: flex;
}
.title {
  width: 200px;
  padding-left: 50px;
  font-size: 25px;
  font-weight: bold;
  color: dodgerblue;
}
</style>